package com.qd.common.panda.domain.entity.hk;

import cn.hutool.core.math.Money;
import lombok.Data;

/**
 * 统计
 *
 * @author sjk
 */
@Data
public class HkParkOrderStatisticsDTO {
    /**
     * 总收费金额
     */
    private Integer totalCost;
    /**
     * 总收费金额，单位元
     */
    private String totalCostDisplay;
    /**
     * 优惠金额
     */
    private Integer deductMoney;
    /**
     * 优惠金额显示，单位元
     */
    private String deductMoneyDisplay;
    /**
     * 支付金额
     */
    private Integer payMoney;
    /**
     * 支付金额显示，单位元
     */
    private String payMoneyDisplay;
    /**
     * 支付方式:1:微信支付2钱包支付
     */
    private Integer payMethod;
    /**
     * 支付方式显示
     */
    private String payMethodDisplay;
    /**
     * 订单数量
     */
    private Long quantity;

    public String getTotalCostDisplay() {
        if (null == totalCost) {
            return "0.00";
        }
        return new Money(0, totalCost).getAmount().toString();
    }

    public String getDeductMoneyDisplay() {
        if (null == deductMoney) {
            return "0.00";
        }
        return new Money(0, deductMoney).getAmount().toString();
    }

    public String getPayMoneyDisplay() {
        if (null == payMoney) {
            return "0.00";
        }
        return new Money(0, payMoney).getAmount().toString();
    }

    public void freeData() {
        this.quantity = null;
        this.totalCost = null;
        this.totalCostDisplay = null;
        this.deductMoney = null;
        this.deductMoneyDisplay = null;
        this.payMoney = null;
        this.payMoneyDisplay = null;
        this.payMethod = null;
        this.payMethodDisplay = null;
    }
}